<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<style>
	.form-horizontal-left .control-label{
		width:150px;
	}
	.form-horizontal-left .help-block{
		padding-left:150px;
	}
	.main-content{
		padding:30px 0;
	}
</style>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<div class="bs-container clearfix">
  <div class="bs-left-container  clearfix"> 
    <!--{template left}--> 
  </div>
  <div class="left-drager">
  </div>
  <div class="bs-main-container  clearfix">
    <div class="main-header clearfix">
      <ul class="nav nav-pills nav-pills-bottomguide"  >
        <li> <a href="{BASESCRIPT}?mod=cloud&op=edit&bz=dzz"> {lang set}</a> </li>
        <li> <a href="{BASESCRIPT}?mod=cloud&op=space">{lang space_management}</a> </li>
        <li class="active"> <a href="{BASESCRIPT}?mod=cloud&op=oauth&bz&bz=qiniu">{lang oauth_qinniu_add}</a> </li>
      </ul>
    </div>
    <div class="main-content clearfix">
        
        <form  name="aliform" class="form-horizontal form-horizontal-left" action="{BASESCRIPT}?mod=cloud&op=oauth" method="post" onsubmit="return validate(this)">
          <input type="hidden" name="qiniusubmit" value="true" />
          <input type="hidden" name="bz" value="qiniu" />
          <input type="hidden" name="formhash" value="{FORMHASH}" />
          <div class="form-group">
            <label class="control-label" for="access_id">AK：</label>
            
              <input type="text" id="access_id" class="form-control"  name="access_id" autocomplete="off" value="$ali[access_id]" onblur="if(this.value==''){jQuery(this).parent().parent().addClass('has-warning');}else{jQuery(this).parent().parent().removeClass('has-warning');}" onfocus="jQuery(this).parent().parent().removeClass('has-warning');" />
              <span class="help-inline">{lang oauth_qinniu_storage} AK</span>
          </div>
          <div class="form-group">
            <label class="control-label" for="access_key">SK：</label>
            
              <input type="password" class="form-control" id="access_key" name="access_key" autocomplete="off" value="$ali[access_id]" onblur="if(this.value==''){jQuery(this).parent().parent().addClass('has-warning');}else{jQuery(this).parent().parent().removeClass('has-warning');}" onfocus="jQuery(this).parent().parent().removeClass('has-warning');" />
            <span class="help-inline">{lang oauth_qinniu_storage} SK</span>
          </div>
          <div class="form-group">
            <label class="control-label">bucket{lang name}</label>
            
              <input type="text" id="bucket" name="bucket" class="form-control" value="" onblur="if(this.value==''){jQuery(this).parent().parent().addClass('has-warning');}else{jQuery(this).parent().parent().removeClass('has-warning');}" onfocus="jQuery(this).parent().parent().removeClass('has-warning');" />
            <span class="help-inline">{lang oauth_qinniu_manage_bucket}</span>
          </div>
          <div class="form-group">
            <label class="control-label" for="hostname">{lang visit_domain_name}</label>
            
              <input type="text" class="form-control" id="hostname" name="hostname" autocomplete="off" value="$ali[hostname]" onfocus="jQuery(this).parent().parent().removeClass('has-warning');" onblur="if(this.value==''){jQuery(this).parent().parent().addClass('has-warning');}else{jQuery(this).parent().parent().removeClass('has-warning');}" />
            <span class="help-inline">{lang oauth_qinniu_storage_bucket}</span>
          </div>
          <div class="form-group">
            <label class="control-label" for="region">{lang storage_region}</label>
            <div class="controls">
              <!--{loop $HOSTS $key $value}-->
              <label class="radio-inline"><input type="radio" <!--{if $key=='huadong'}--> checked="checked"<!--{/if}--> name="region" value="$key" /> $value['title']</label>
              <!--{/loop}--> 
			  </div>
            
          </div>
          <div class="form-group">
            <label class="control-label"></label>
              <input type="submit" class="btn btn-primary" value="{lang add}">
          </div>
        </form>
    </div>
  </div>
</div>
<script type="text/javascript">
jQuery('.left-drager').leftDrager_layout();
function validate(form){
	if(jQuery("#access_id").val()==''){
		jQuery("#access_id").parent().parent().addClass('has-warning');
		return false;
	}else if(jQuery("#access_key").val()==''){
		jQuery("#access_key").parent().parent().addClass('has-warning');
		return false;
	}else if(jQuery("#bucket").val()==''){
		jQuery("#bucket").parent().parent().addClass('has-warning');
		return false;
	}else if(jQuery("#hostname").val()==''){
		jQuery("#hostname").parent().parent().addClass('has-warning');
		return false;
	}
	return true;
}
 </script>  
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
 
<!--{template common/footer_simple}--> 
